import Vue from 'vue'
import Router from 'vue-router'
import routes from "./routes/index.js"

//  解决重复跳转同一个链接   抛出异常问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)
const router = new Router({
    mode: 'history',
    base : process.env.BASE_URL,
    routes
})
export default router